import { defineStore } from 'pinia'
import { ref } from 'vue'

// 使用setup模式定义
export const appStore = defineStore(
  'appStore',
  () => {
    const isCollapse = ref<boolean>(false)

    function CHANGE_SIDEBAR(status: boolean) {
      isCollapse.value = status
    }

    function toggleSideBar() {
      CHANGE_SIDEBAR(!isCollapse.value)
    }
    return { isCollapse, toggleSideBar }
  },
  {
    persist: true,
  },
)
